import request from '@/utils/request'

// 系统公告
// 获取系统公告分页
export function requestAnnouncementPage(data) {
  return request({
    url: '/system/sys/announcement/page',
    method: 'post',
    data: data,
  })
}
// 获取系统公告创建
export function requestAnnouncementCreate(data) {
  return request({
    url: '/system/sys/announcement/create',
    method: 'post',
    data: data,
  })
}

// 获取系统公告更新
export function requestAnnouncementUpdate(data) {
  return request({
    url: '/system/sys/announcement/updateById',
    method: 'post',
    data: data,
  })
}

// 获取系统公告删除
export function requestAnnouncementDelete(data) {
  return request({
    url: `/system/sys/announcement/delete/${data.id}`,
    method: 'post',
    data: data,
  })
}

// 获取系统公告批量删除
export function requestAnnouncementBatchDelete(list) {
  return request({
    url: '/system/sys/announcement/deleteBatch',
    method: 'post',
    data: list.map((item) => item.id),
  })
}

// 获取我的通知分页
export function requestAnnouncementMyPage(data) {
  return request({
    url: '/system/sys/announcement/myPage',
    method: 'post',
    data,
  })
}

// 修改系统通知已读
export function requestAnnouncementUpdateMyNoticeStatus(params) {
  return request({
    url: '/system/sys/announcement/updateMyAnnouncementStatus',
    method: 'get',
    params,
  })
}

// 批量修改系统公告已读
export function requestAnnouncementBatchUpdataStatus(data) {
  return request({
    url: '/system/sys/announcement/batchUpdataStatus',
    method: 'post',
    data,
  })
}
